﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using Database;

namespace Business
{
    public class QuanLyXemDanhSachLop
    {
        TrungTamEntities TrungTam;
        public QuanLyXemDanhSachLop()
        {
            TrungTam = new TrungTamEntities();
        }

        public ArrayList LayDanhSachLopHoc()
        {
            ArrayList arrayLH = new ArrayList();
            var today = DateTime.Today;
            var dsLopHoc = (from lh in TrungTam.LopHocs
                            join nv in TrungTam.NhanViens on lh.GiaoVienPT equals nv.MaNV
                            where lh.NgayKhaiGiang.Value >= today
                            select new { lh.MaLop, lh.MoTa, nv.HoTenNV, lh.PhongHoc, lh.LichHoc, lh.NgayKhaiGiang, lh.SiSo, lh.HocPhi }).ToList();
            foreach(var i in dsLopHoc){
                arrayLH.Add(i);
            }
            return arrayLH;
        }
    }
}
